package com.hzit.servlet;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * 类名：
 * 作者：WF
 * 功能：
 */
@WebServlet("/hello")
public class HelloServlet extends HttpServlet {
	//1. 中执行一次
	@Override
	public void init() throws ServletException {
		System.out.println("init...");
	}
	//2. 执行多次
	// @Override
	// protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
	// 	System.out.println("doGet...");
	// }
	//2. 执行多次
	// @Override
	// protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
	// 	System.out.println("doPost...");
	// }

	// 每次请求都会执行
	@Override
	protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		System.out.println("service....");
	}
}
